package com.henry.consumer;

import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;

/**
 * 消息处理接口
 *
 * @author Liu Hanlin
 * @create 2025-11-13 21:01
 */
public abstract class ConcurrentConsumer implements MessageListenerConcurrently, Consumer{

    /**
     * 最小消费线程数
     * @return
     */
    public int getMinConsumeThreads() {
        return 20;
    }

    /**
     * 最大消费线程数
     * @return
     */
    public int getMaxConsumeThreads() {
        return 20;
    }

    /**
     * 消息业务侧处理
     *
     * @param msgId 消息id
     * @param key 业务key
     * @param msg 消息体
     * @return 消费状态
     */
    public abstract ConsumeConcurrentlyStatus consumeMessage(String msgId, String key, String msg);
}
